//
//  ViewController.m
//  Im
//
//  Created by ExcuseMe on 16/12/7.
//  Copyright © 2016年 1512. All rights reserved.
//

#import "ViewController.h"
@interface ViewController ()
{
UIImageView *view1;
UIButton *bt1;

}
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    view1=[[UIImageView alloc]init];
    view1.image = [UIImage imageNamed:@"7.jpg"];
    view1.frame=CGRectMake(0, 0, 320, 570);
    [self.view addSubview:view1];
    
    [self.progressSlider setThumbImage:[UIImage imageNamed:@"slider.png"] forState:UIControlStateNormal];
    [self.progressSlider setThumbImage:[UIImage imageNamed:@"slider.png"]forState:UIControlStateHighlighted];
    self.progressSlider = [[UISlider alloc]initWithFrame:CGRectMake(0, 44, 30, 30)];

    [view1 addSubview:_progressSlider];


    /* UIToolbar *toolBar = [[UIToolbar alloc] init];
    // 2. 设置frame
    toolBar.frame = [UIScreen mainScreen].bounds;
    // 3. 设置模糊的样式
    toolBar.barStyle = UIBarStyleBlack;
    // 4. 添加到imageView
    [self.imageView addSubview:toolBar];*/
    
    
    // [view1 setImageToBlur:[UIImage imageNamed:@"7.jpg"] blurRadius:kLBBlurredImageDefaultBlurRadius completionBlock:^(){}];
   
    // 创建自定义按钮


   UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    // 创建普通状态按钮图片
    [btn setBackgroundImage:[UIImage imageNamed:@"Player"] forState:UIControlStateNormal];
    // 创建高亮或选中状态按钮图片
    [btn setBackgroundImage:[UIImage imageNamed:@"Pause"] forState:UIControlStateHighlighted];
    // 按钮坐标和尺寸
    btn.frame = CGRectMake(320/2-25, 508-50, 50, 50);
    btn.layer.cornerRadius = 50/2.0;
    btn.layer.masksToBounds = YES;
    btn.layer.borderWidth = 2.0;
    btn.layer.borderColor = [[UIColor blackColor]CGColor];
    [self.view addSubview:btn];
    
    UIButton *btNexta = [UIButton buttonWithType:UIButtonTypeCustom];
   [btNexta setBackgroundImage:[UIImage imageNamed:@"NextA"] forState:UIControlStateNormal];
    btNexta.frame = CGRectMake(160+60, 508-50, 40, 40);
    btNexta.layer.cornerRadius = 40/2.0;
    btNexta.layer.masksToBounds = YES;
    btNexta.layer.borderWidth = 2.0;
    btNexta.layer.borderColor = [[UIColor blackColor]CGColor];
    [self.view addSubview:btNexta];
    
    UIButton *btNextb = [UIButton buttonWithType:UIButtonTypeCustom];
    [btNextb setBackgroundImage:[UIImage imageNamed:@"NextB"] forState:UIControlStateNormal];
    btNextb.frame = CGRectMake(160-100, 508-50, 40, 40);
    btNextb.layer.cornerRadius = 40/2.0;
    btNextb.layer.masksToBounds = YES;
    btNextb.layer.borderWidth = 2.0;
    btNextb.layer.borderColor = [[UIColor blackColor]CGColor];
    [self.view addSubview:btNextb];
  // 按钮按下后的模糊状态
    [btn setAdjustsImageWhenHighlighted:YES];
    // 按钮点击事件
 //   [btn_click addTarget:self action:@selector(clickAction:) forControlEvents:UIControlEventTouchUpInside];
    // 按钮图片和标题总高度
    //CGFloat totalHeight = (btn.imageView.frame.size.height + btn.titleLabel.frame.size.height);
    // 设置按钮图片偏移
   // [btn setImageEdgeInsets:UIEdgeInsetsMake(-(totalHeight - btn.imageView.frame.size.height), 0.0, 0.0, -btn.titleLabel.frame.size.width)];
    // 设置按钮标题偏移
  //  [btn setTitleEdgeInsets:UIEdgeInsetsMake(0.0, -btn.imageView.frame.size.width, -(totalHeight - btn.titleLabel.frame.size.height),0.0)];
    // 加载按钮到视图
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
 
    
}

@end
